<?php

namespace app\common\model;


class Video extends BaseModel
{
    // 表名
    protected $name = 'video';
    // 追加属性
    protected $append = [

    ];


    public function category()
    {
        return $this->belongsTo('app\common\model\video\Category', 'category_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function chapter()
    {
        return $this->hasMany(VideoChapter::class, 'video_id', 'id');
    }
}
